import  random
def e():
    a = random.randint(0,10)
    b = int(input())
    player = 5000
    while a>b or a<b:
        if player >= 0:
            b = int(input("请输入数字："))
            if a < b:
                print("大了")
                player-=500
                continue
            elif a > b:
                print("小了")
                player-=500
                continue
            else:
                print("恭喜猜中，本轮幸运数字：%d" %(b))
                player+=3000
                i()
                break
        else:
            print("本金余额不足，游戏结束")
            break
    else:
        print("恭喜猜中，本轮幸运数字：%d" % (b))
        player += 3000

def i():
    d = input("请输入是或者否：")
    if d=="是":
        print("继续下一轮游戏")
        e()
    elif d=="否":
        print("游戏结束")
e()